package com.xuxin.pda.network;

import com.xuxin.pda.bean.BaseBean;
import com.xuxin.pda.bean.CommitBean;
import com.xuxin.pda.bean.CompanyBean;
import com.xuxin.pda.bean.DepartmentBean;
import com.xuxin.pda.bean.DptBean;
import com.xuxin.pda.bean.LinkBean;
import com.xuxin.pda.bean.LoginBean;
import com.xuxin.pda.bean.MemberBean;
import com.xuxin.pda.bean.TrashEnterBean;
import com.xuxin.pda.bean.TrashExitBean;
import com.xuxin.pda.bean.TrashSummaryBean;
import com.xuxin.pda.bean.TrashTypeBean;
import com.xuxin.pda.bean.WarehouseBean;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;

/**
 * Created by xu_xin
 * Created on 2020.06.05
 */
public interface RetrofitApi {

    /**
     * 登录
     */
    @POST("api/services/app/Med_Members/Login")
    Observable<LoginBean> login(@Query("eNum") String eNum);

    /**
     * 废物类型
     */
    @GET("/api/services/app/Med_Category/GetAll")
    Observable<TrashTypeBean> getTrashType();

    /**
     * 获取科室信息
     */
    @GET("/api/services/app/Med_Department/Getdept_Name")
    Observable<DepartmentBean> getDepartment(@Query("departmentId") String departmentId);

    /**
     * 医废收集
     */
    @POST("/api/services/app/Med_LittleInfo/CreateDtl")
    Observable<CommitBean> commit(@Body RequestBody requestBody);

    /**
     * 箱袋关联
     */
    @POST("/api/services/app/Med_LittleInfo/Relation")
    Observable<LinkBean> link(@Query("boxId") String BoxId,
                              @Query("PackageCodes") String PackageCode);

    /**
     * 医废入库
     */
    @POST("/api/services/app/Med_LittleInfo/InWarehouse")
    Observable<TrashEnterBean> trashEnter(@Query("WarehouseId") String WarehouseId,
                                          @Query("InWarehouseTime") String InWarehouseTime,
                                          @Query("UserId") String UserId,
                                          @Query("BoxIds") String BoxIds);

    /**
     * 查询库房
     */
    @GET("/api/services/app/Med_LittleInfo/GetWarehouseInfo")
    Observable<WarehouseBean> GetWarehouseInfo(@Query("WarehouseId") String WarehouseId);

    /**
     * 医废出库
     */
    @POST("/api/services/app/Med_LittleInfo/OutWarehouse")
    Observable<TrashExitBean> trashExit(@Query("name") String name,
                                        @Query("WarehouseId") String WarehouseId,
                                        @Query("UserId") String UserId,
                                        @Query("message") String message);

    /**
     * 查询
     */
    @GET("/api/services/app/Med_LittleInfo/GetMed_LittleInfo_In_MOrD_Query")
    Observable<TrashSummaryBean> getTrashSummary(@Query("year") String year,
                                                 @Query("month") String month,
                                                 @Query("day") String day,
                                                 @Query("In_MOrD") String In_MOrD);

    /**
     * 获取科室列表
     */
    @GET("/api/services/app/Med_Department/GetAll")
    Observable<DptBean> getDptList(@Query("skipCount") int skipCount,
                                   @Query("maxResultCount") int maxResultCount);

    /**
     * 获取工号列表
     */
    @GET("/api/services/app/Med_Members/GetList")
    Observable<MemberBean> getMemberList(@Query("skipCount") int skipCount,
                                         @Query("maxResultCount") int maxResultCount);

    /**
     * 删除医废收集信息
     */
    @DELETE("/api/services/app/Med_LittleInfo/Delete")
    Observable<BaseBean> deleteTrash(@Query("Id") String Id);

    /**
     * 删除医废收集信息
     */
    @GET("/api/services/app/Med_TransferCompany/GetAll")
    Observable<CompanyBean> getCompany(@Query("SkipCount") int SkipCount,
                                       @Query("MaxResultCount") int MaxResultCount);
}